import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Database implements Serializable {

    private static final long serialVersionUID = -4590310423195648112L;
    public static final File DATABASE_PATH = new File("Server/file/database");
    private static Database database;
    private static boolean isInitialized = false;

    private List<ChoiceQuestion> choiceQuestionList = new ArrayList<>();
    private List<TrueOrFalseQuestion> trueOrFalseQuestionList = new ArrayList<>();
    private List<User> userList = new ArrayList<>();
    private List<String> userNameList = new ArrayList<>();


    private Database() {}

    public Database(String str) {
        System.out.println("a temp database be built");
    }

    public static Database getInstance() {
        return database;
    }

    public static void DatabaseInit(Database database) {
        if (!isInitialized) {
            Database.database = database;
            isInitialized = true;
        }
    }

    public List<ChoiceQuestion> getChoiceQuestionList() {
        return choiceQuestionList;
    }

    public List<TrueOrFalseQuestion> getTrueOrFalseQuestionList() {
        return trueOrFalseQuestionList;
    }

    public List<User> getUserList() {
        return userList;
    }

    public List<String> getUserNameList() {
        return userNameList;
    }
}
